#pragma once
#include <QCoreApplication>
#include <QWidget>

#define APP_DIR QCoreApplication::applicationDirPath()

inline void AdjustPosition(QWidget *a, QWidget *b) {
    b->move(a->x() + (a->width() - b->width()) / 2,
            a->y() + (a->height() - b->height()) / 2);
}

template<typename T>
void SetPointSize(T *t, int size) {
    QFont font = t->font();
    font.setPointSize(size);
    t->setFont(font);
}

inline void LimitSize(QWidget *w, QSize size) {
    w->setMinimumSize(size);
    w->setMaximumSize(size);
}
